package com.hgw.Demo03_DecoratorPattern.decorator;

/**
 * Data time:2021/12/14 16:53
 * StudentID:2019112118
 * Author:hgw
 * Description: 培根类，具体装饰类
 */
public class Bacon extends Garnish{
    public Bacon(FastFood fastFood) {
        super(fastFood, 3, "加培根");
    }

    @Override
    public float cost() {
        return getPrice() + getFastFood().cost();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + getFastFood().getDesc();
    }
}
